﻿Imports System
Imports System.ComponentModel.Design.Serialization
Imports System.Workflow.ComponentModel

Namespace System.Workflow.ComponentModel.Serialization
    Friend Class BindMarkupExtensionSerializer
        Inherits MarkupExtensionSerializer
        ' Methods
        Protected Overrides Function GetInstanceDescriptor(ByVal serializationManager As WorkflowMarkupSerializationManager, ByVal value As Object) As InstanceDescriptor
            Dim bind As ActivityBind = [TryCast](value,ActivityBind)
            If (bind Is Nothing) Then
                Throw New ArgumentException(SR.GetString("Error_UnexpectedArgumentType", New Object() { GetType(ActivityBind).FullName }), "value")
            End If
            Return New InstanceDescriptor(GetType(ActivityBind).GetConstructor(New Type() { GetType(String) }), New Object() { bind.Name })
        End Function

    End Class
End Namespace

